﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RC_PlacementByExam.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.RC_PlacementByExam" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Reference Control="../UserControls/RC_CmdPlacementExam.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../Scripts/DatePicker.js"></script>
    <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
        <script type="text/javascript"> 
           
            function isNumberKey(event)  // ตัวเลขอย่างเดียว
          {
             var charCode = (event.which) ? event.which : event.keyCode
             if(charCode > 31 && (charCode < 48 || charCode > 57)){
                 alert("กรอกได้เฉพาะตัวเลข !!");        
                 return false;
	          }
             return true;
          }
          function isNumberKeyDot(event)  // ตัวเลขทศนิยม
          {
             var charCode = (event.which) ? event.which : event.keyCode
             if(charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 46){
             //    alert("กรอกได้แต่ตัวเลขทศนิยมครับ!")
                 return false;
	          }
             return true;
          }         
           function onTextChange(sender) 
           {
               if (sender.get_value() == "") {
                   sender.set_text("");
               }
           }
           function openReport(rptName) {
               radopen("RPT_Exports.aspx?ReportName=" + rptName, "RadWindow1");
           }
        </script>
        
    </telerik:RadCodeBlock>
</head>
<body >
     <form id="mainForm" runat="server">   
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="CrystalReportViewer1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>          
            
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadWindowManager ID="RadWindowManager2" runat="server">
        <Windows>
            <telerik:RadWindow 
                id="RadWindow1" 
                runat="server"        
                showcontentduringload="false"
                VisibleStatusbar="false"
                AutoSize = "true"
                title="รายงาน"      
                Modal="true"
                Skin = "Vista"
                behaviors="Close">
            </telerik:RadWindow>
        </Windows>

        </telerik:RadWindowManager>    
           
<div class="moduleDivSlim1000x450">
<div class="moduleDivBottom1000">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
<table>

<tr>

<td>
  
    <table width = "980px" align = "center">
        <tr>
        <td class ="tableHeader">บัญชีรายละเอียด 
        <asp:Label ID="lblName" runat="server" ForeColor="Red"></asp:Label>&nbsp;แนบท้ายคำสั่งที่ 
        <asp:Label ID="lblRefNo" runat="server" ForeColor="Red"></asp:Label>&nbsp;ลงวันที่  
        <asp:Label ID="lblApvDate" runat="server" ForeColor="Red"></asp:Label>  
        <asp:Label ID="lblCmdSeq" runat="server" Visible = "false"></asp:Label>
        <asp:Label ID="lblEmpType" runat="server" Visible = "false"></asp:Label>  
        <asp:Label ID="lblCmdType" runat="server" Visible = "false"></asp:Label>                    
        </td>
        </tr>
     </table>
 
 <table width = "980px" align = "center">
 <tr>
 <td>
     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
         <asp:Panel ID="RadGrid1Panel" runat="server" Height="400px" Width = "970" ScrollBars ="Auto">         
 
                    <telerik:RadGrid 
                            ID="RadGrid1" 
                            runat="server" 
                            AllowAutomaticDeletes="True" 
                            AllowFilteringByColumn="True" 
                            AllowMultiRowEdit="True" 
                            AllowMultiRowSelection="True" 
                            AllowPaging="True" 
                            AllowSorting="True" 
                            AutoGenerateColumns="False" 
                            EnableAJAX="True" 
                            EnableAJAXLoadingTemplate="True" 
                            GridLines="None" 
                            OnItemCommand="RadGrid1_ItemCommand" 
                            Skin="Outlook" 
                            Width="950px"  >
                            <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" 
                                ClientDataKeyNames="cmd_dtls_seq" 
                                CommandItemDisplay="Top" 
                                DataKeyNames="cmd_dtls_seq" 
                                InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                                NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                                <CommandItemTemplate>                                        
                                    <table width="100%">
                                        <tr>
                                            <td>
                                                <asp:LinkButton ID="cmdAddNew" runat="server" 
                                                    CausesValidation="False" 
                                                    CommandName="InitInsert"                                                    
                                                    Visible="<%# !RadGrid1.MasterTableView.IsItemInserted && RadGrid1.EditIndexes.Count <= 0 %>"> <img style="border:0px;vertical-align:middle;" alt="" 
                                        src="../Images/Buttons/AddRecord.gif" /> เพิ่มรายชื่อบุคลากร</asp:LinkButton>
                                               </td>
                                            <td align="right">
                                                <asp:LinkButton ID="cmdPrint" CommandName="PrintPreview" runat="server" CausesValidation="False" > <img alt="" src="../Images/Buttons/Print1.gif" 
                                                    style="border: 0px; vertical-align: middle;" /> พิมพ์ </asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </CommandItemTemplate>
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="15px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="15px" />
                                </ExpandCollapseColumn>                                
                                <Columns>

                                <telerik:GridEditCommandColumn 
                                        EditText = "คลิกเพื่อแก้ไขรายการ"
                                        ButtonType="ImageButton">
                                        <HeaderStyle HorizontalAlign="Center" Width="15px" />
                                        <ItemStyle HorizontalAlign="Center" Width="15px" />
                                    </telerik:GridEditCommandColumn>
                                    <telerik:GridButtonColumn 
                                        ButtonType="ImageButton" 
                                        CommandName="Delete" 
                                        ConfirmDialogType="RadWindow" 
                                        ConfirmText="ลบข้อมูลที่เลือก?" 
                                        ItemStyle-Width="15" 
                                        Text="คลิกเพื่อลบรายการ" 
                                        UniqueName="column1">
                                        <HeaderStyle HorizontalAlign="Center" Width="15px" />
                                        <ItemStyle HorizontalAlign="Center" Width="15px"/>
                                    </telerik:GridButtonColumn>                               
                                    
                                    <telerik:GridBoundColumn 
                                        DataField="full_name" 
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter ="true"
                                        ShowFilterIcon ="false"
                                        HeaderText="ชื่อ - สกุล" 
                                        UniqueName="full_name">                                       
                                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                     </telerik:GridBoundColumn>                           
                                    <telerik:GridBoundColumn 
                                        DataField="new_pos_ref" 
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter ="true"
                                        ShowFilterIcon ="false"
                                        HeaderText="เลขที่ตำแหน่ง" 
                                        UniqueName="new_pos_ref">                                       
                                        <HeaderStyle HorizontalAlign="Center" Width="80px" />
                                     </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn 
                                        DataField="new_pos_name" 
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter ="true"
                                        ShowFilterIcon ="false"
                                        HeaderText="ตำแหน่ง" 
                                        UniqueName="new_pos_name">                                       
                                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                     </telerik:GridBoundColumn>
                                     <telerik:GridBoundColumn 
                                        DataField="new_class_name" 
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter ="true"
                                        ShowFilterIcon ="false"
                                        HeaderText="ระดับ" 
                                        UniqueName="new_class_name">                                       
                                        <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                     </telerik:GridBoundColumn>
                                     <telerik:GridBoundColumn 
                                        DataField="new_job_site_name" 
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter ="true"
                                        ShowFilterIcon ="false"
                                        HeaderText="สังกัด" 
                                        UniqueName="new_job_site_name">                                       
                                        <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                     </telerik:GridBoundColumn>
                                     
                                     <telerik:GridBoundColumn 
                                        DataField="new_salary" 
                                        DataFormatString = "{0:N0}"
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter ="true"
                                        ShowFilterIcon ="false"
                                        HeaderText="เงินเดือน" 
                                        ItemStyle-HorizontalAlign = "Right"
                                        UniqueName="new_salary">                                       
                                        <HeaderStyle HorizontalAlign="Center" Width="80px" />
                                     </telerik:GridBoundColumn>                                         
                                      <telerik:GridBoundColumn 
                                        DataField="remarks" 
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter ="true"
                                        ShowFilterIcon ="false"
                                        HeaderText="หมายเหตุ" 
                                        UniqueName="remarks">                                       
                                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                     </telerik:GridBoundColumn>                                                        
                                  
                                </Columns>
                                <EditFormSettings                                     
                                    EditFormType="WebUserControl" 
                                    UserControlName="../UserControls/RC_CmdPlacementExam.ascx">
                                    <EditColumn UniqueName="EditCommandColumn1"></EditColumn>
                                </EditFormSettings>                                
                                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                            </MasterTableView>
                            <ClientSettings AllowColumnHide="True" 
                                AllowColumnsReorder="True" 
                                EnableRowHoverStyle="True" 
                                ReorderColumnsOnClient="True">
                                <Selecting AllowRowSelect="True" 
                                EnableDragToSelectRows="true" />
                                </ClientSettings>
                        </telerik:RadGrid>                        
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>                
</td>
 </tr>
 </table>      

    </td>
    </tr>
    </table>
    </asp:ScriptManager> 
    
 </div> 
</div> 
     
</form>
</body>
</html>